package com.jacklin.product.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.jacklin.product.domain.Product;

/**
 * @describe: 商品库存服务层
 * @author: jacklin
 * @date: 2022-03-24 22:47
 */
public interface ProductService extends IService<Product> {

    /**
     * 获取最新库存数量
     *
     * @author: jacklin
     * @date: 2022/8/4 9:13
     **/
    int getStock(Integer id);

    /**
     * 扣减库存
     *
     * @author: jacklin
     * @date: 2022/8/4 9:12
     **/
    Boolean reduceStock(Integer id, Integer amount);

}
